<template>
  <view class="viewport"> </view>
</template>

<script setup lang="ts">
import { getHotAPI } from "@/service/hot";

const query = defineProps<{
  type: string;
}>();

// 热门推荐页 标题和url
const hotMap = [
  { type: "1", title: "特惠推荐", url: "/hot/preference" },
  { type: "2", title: "爆款推荐", url: "/hot/inVogue" },
  { type: "3", title: "一站买全", url: "/hot/oneStop" },
  { type: "4", title: "新鲜好物", url: "/hot/new" },
];

uni.setNavigationBarTitle({
  title: hotMap.find((item) => item.type === query.type)?.title || "热门推荐",
});

const loadHotData = async () => {
  const res = await getHotAPI(
    hotMap.find((item) => item.type === query.type)?.url || "/hot/preference",
  );
};
loadHotData();
</script>

<style lang="scss" scoped></style>
